package com.dragon.design.pattern.structural.compoiste;

/**
 * 课程
 *
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/18 10:55
 */
public class Course extends CatalogComponent {

    private String name;

    private Double price;

    public Course(String name, Double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public double getPrice(CatalogComponent catalogComponent) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("Course name:" + this.name + "price:" + this.price);
    }
}
